//name代表你要写的名称
const mongoose = require("./db");

let userSchema = new mongoose.Schema({
  username: String,
  password: String,
  img: String,
  tel: Number,
  idCard: String,
  sex: Number,
  birthday: Date,
  email: String,
  detailed: [
    {
      message: String,
      time: String,
    },
  ],
  follow:Number,
  save:Number,
  points:Number,
  coupon:Number
});
let doctorSchema = new mongoose.Schema({
  username: String,
  password: String,
  img: String,
  tel: Number,
  idCard: String,
  sex: Number,
  birthday: Date,
  email: String,
  detailed: [
    {
      message: String,
      time: String,
    },
  ],
});

let userModel = mongoose.model("user", userSchema, "user");
let doctorModel = mongoose.model("doctor", doctorSchema, "doctor");

module.exports = { userModel,doctorModel };